<?php 
//print_r($_FILES);
//move_uploaded_file($_FILES['pic']['tmp_name'],'./'.$_FILES['pic']['name']);
//生成随机文件名
$fname = mt_rand(1000000,9999999);

//后缀名
$ext = strrchr($_FILES['pic']['name'],'.');
//echo $ext;

//路径
$path = './'.date('Y/m/d');
//创建目录
if(!is_dir($path)){
	mkdir($path,0777,true);
}
if(move_uploaded_file($_FILES['pic']['tmp_name'], $path.'/'.$fname.$ext)){
	echo "移动成功";
}else{
	echo "移动失败";
}
